package sj6;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import sj6.entity.User;
import sj6.service.Userservice;

public class UserTest6 {
    @Test
    public void testUser(){
        ApplicationContext context=new ClassPathXmlApplicationContext("sj6/sj6.xml");
        Userservice userservice=(Userservice) context.getBean("userService");
        User user=new User();
        user.setUserName("晴晴");
        user.setPassword("123456");
        boolean save= userservice.save(user);
        if(save){
            System.out.println("保存成功");
        }else {
            System.out.println("保存失败");
        }
    }
}
